//
//  YHUserModel.swift
//  XLWB
//
//  Created by key on 16/6/29.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit

class YHUserModel: NSObject {

    //MARK: 转模属性
    // 用户UID
    var id: Int = 0
    
    // 用户昵称
    var screen_name: String?
    
    // 用户头像地址（中图），50×50像素
    var profile_image_url: String?
    
    
    // 用户认证类型
    var verifiedImg: UIImage?
    // 认证类型，-1：没有认证，0，认证用户，2,3,5: 企业认证，220: 达人
    var verified_type: Int = -1 {
        
        didSet{
            
            switch verified_type {
                
            case 0:
                verifiedImg = UIImage(named:"avatar_grassroot")
                
            case 2,3,5:
                verifiedImg = UIImage(named:"avatar_enterprise_vip")
                
            case 220:
                verifiedImg = UIImage(named:"avatar_vip")
                
            default:
                verifiedImg = UIImage(named:"avatar_vgirl")
                
            }
            
        }
    }
    

    
    // 会员等级
    var mbrankImg: UIImage?
    // 会员等级 0-6
    var mbrank: Int = 0 {
        
        didSet{
            
            if mbrank > 0 && mbrank < 7 {
                
                mbrankImg = UIImage(named:"common_icon_membership_level\(mbrank)")
                
            }else{
                
                mbrankImg = UIImage(named:"common_icon_membership_expired")
            }
            
            
        }
    }
    
    
    
    //MARK: - KVC构造函数
    init(dict: [String: AnyObject]) {
        
        super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
    }
    
}
